Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.LogWrap = undefined;
var o = true;
var exp_LogWrap = /* */function () {
  function _ctor() {
    babel_classCallCheck(this, _ctor);
  }
  return babel_createClass(_ctor, null, [{
    key: "getDateString",
    value: function getDateString() {
      var e = new Date();
      var t = e.getHours().toString();
      var n = "";
      n += (1 == t.length ? "0" + t : t) + ":";
      n += (1 == (t = e.getMinutes().toString()).length ? "0" + t : t) + ":";
      n += (1 == (t = e.getSeconds().toString()).length ? "0" + t : t) + ":";
      1 == (t = e.getMilliseconds().toString()).length && (t = "00" + t);
      2 == t.length && (t = "0" + t);
      return "[" + (n += t) + "]";
    }
  }, {
    key: "stack",
    value: function stack(e) {
      var t = new Error().stack.split("\n");
      t.shift();
      var n = [];
      t.forEach(function (e) {
        var t = (e = e.substring(7)).split(" ");
        if (t.length < 2) {
          n.push(t[0]);
        } else {
          n.push(babel_defineProperty({}, t[0], t[1]));
        }
      });
      var o = [];
      if (e < n.length - 1) {
        for (var s in n[e]) {
          o.push(s);
        }
      }
      var _i14 = o[0].split(".");
      return _i14[0] + ".js->" + _i14[1] + ": ";
    }
  }, {
    key: "log",
    value: function log() {
      var t = console.log || cc.log;
      var _len = arguments.length;
      var e = new Array(_len);
      for (var _key = 0; _key < _len; _key++) {
        e[_key] = arguments[_key];
      }
      o && t.call(this, "%s%s:" + cc.js.formatStr.apply(cc, e), _ctor.stack(2), _ctor.getDateString());
    }
  }, {
    key: "info",
    value: function info() {
      var t = console.log || cc.log;
      var _len2 = arguments.length;
      var e = new Array(_len2);
      for (var _key2 = 0; _key2 < _len2; _key2++) {
        e[_key2] = arguments[_key2];
      }
      o && t.call(this, "%c%s%s:" + cc.js.formatStr.apply(cc, e), "color:#00CD00;", _ctor.stack(2), _ctor.getDateString());
    }
  }, {
    key: "warn",
    value: function warn() {
      var t = console.log || cc.log;
      var _len3 = arguments.length;
      var e = new Array(_len3);
      for (var _key3 = 0; _key3 < _len3; _key3++) {
        e[_key3] = arguments[_key3];
      }
      o && t.call(this, "%c%s%s:" + cc.js.formatStr.apply(cc, e), "color:#ee7700;", _ctor.stack(2), _ctor.getDateString());
    }
  }, {
    key: "err",
    value: function err() {
      var t = console.log || cc.log;
      var _len4 = arguments.length;
      var e = new Array(_len4);
      for (var _key4 = 0; _key4 < _len4; _key4++) {
        e[_key4] = arguments[_key4];
      }
      o && t.call(this, "%c%s%s:" + cc.js.formatStr.apply(cc, e), "color:red", _ctor.stack(2), _ctor.getDateString());
    }
  }]);
}();
exports.LogWrap = exp_LogWrap;